﻿/*
 * Created by SharpDevelop.
 * User: Andrew Sadler
 * Date: 08/09/2012
 * Time: 08:45
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;
using System.Drawing;

namespace RRRSRoguelike.Entities.Props
{
	/// <summary>
	/// Description of Door.
	/// </summary>
	public class Door:Prop
	{
		private bool open = true;
		
		/// <summary>
		/// constructor
		/// </summary>
		/// <param name="position"></param>
		public Door(Point position):base("'",ConsoleColor.DarkCyan,position)
		{
			
		}
		
		/// <summary>
		/// returns true if open
		/// </summary>
		public bool IsOpen
		{
			get{return open;}
		}
		
		/// <summary>
		/// toggle to open or close a door.
		/// </summary>
		public void Open()
		{
			if (!open)
			{
			open = true;
			ImageCharacter = "'";
			Walkable = true;}
			else
			{
				Close();
			}
		}
		
		private void Close()
		{
			open = false;
			ImageCharacter = "+";
			Walkable = false;
		}
	}
}
